package top.superxuqc.autocheckincqupt.domain;

import java.io.Serializable;

/**
 * 请填写类的描述
 *
 * @author xuqicheng1
 * @date 2021-07-15 18:36
 */
public class ApiResult<T> implements Serializable {
    private String code;
    private String msg;
    private T data;
    public ApiResult(){

    }
    public void success(){
        this.code = "200";
        this.msg = "success";
    }
    public void fail(String msg){
        this.code = "400";
        this.msg = msg;
    }
    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }

    public T getData() {
        return data;
    }

    public void setData(T data) {
        this.data = data;
    }

    public ApiResult(T data){
        this.code = "200";
        this.msg = "success";
        this.data  = data;
    }

    public ApiResult(String code, String msg, T data) {
        this.code = code;
        this.msg = msg;
        this.data = data;
    }
}
